package controller;

import core.BaseServlet;
import service.OrderService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "OrderServlet", urlPatterns = "/order")
public class OrderServlet extends BaseServlet {

    private OrderService orderService = new OrderService();

    /**
     * 订单管理页面
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void orderManagePage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.getRequestDispatcher("/WEB-INF/pages/orderManage/orderManage.jsp").forward(request,response);
    }

    /**
     * 订单管理页面数据
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void orderList(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        orderService.orderList(request, response);
    }

    /**
     * 订单详细数据
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    public void orderInfoPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        orderService.orderInfoPage(request, response);
    }
}
